package com.societyGames.codeAlong.state.codeExercise.model
{
public class CaseData
{
  public var swfFileName:String; 	//The SWF containing the test case.
  public var className:String;	//The class representing the test case
  public var initializationXml:XML;	//Any initialization XML for the test case.
  public var repeatCount:int = 1; //Number of times to run it. Defaults to 1.
  public var maximumActionCount:uint = uint.MAX_VALUE;

  public function CaseData()
  {
  }

  public static function fromXml(xml:XML):CaseData
  {
    var caseData:CaseData = new CaseData();
    caseData.swfFileName = xml.@swf;
    caseData.className = xml["@class"];
    if ("@repeat" in xml)
    {
      caseData.repeatCount = int(xml.@repeat);
    }
    if ("@actions" in xml)
    {
      caseData.maximumActionCount = uint(xml.@actions)
    }
    caseData.initializationXml = xml;
    return caseData;
  }
}
}